package com.lindenvalley.de.parsers;

import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import com.lindenvalley.de.content.Section;

public class DataXmlParser extends AbstractXmlParser {

	private final String TAG_Section = "section";
	private final String TAG_Questions = "questions";
	
	@Override
	public Map<Integer, Section> parse(String data) {
		if (data == null || data.length() == 0)
			return null;
		
		Map<Integer, Section> sections = new HashMap<Integer, Section>();
		try {
			xpp.setInput(new StringReader(data));
			int eventType = xpp.getEventType();
			String value;
			 while (eventType != XmlPullParser.END_DOCUMENT) {
				 switch (eventType){
		        	case XmlPullParser.START_TAG:
		        		value = xpp.getName();		        		
		        		break;
		        	case XmlPullParser.END_TAG:
		        	case XmlPullParser.TEXT:
				 }
				 
			 }
		} catch (XmlPullParserException e) {
			// TODO Auto-generated catch block
			return null;
		}
		
		
		return sections;
	}

}
